abstract class Game {
    abstract initialize(): void;
    abstract startPlay(): void;
    abstract endPlay(): void;
    public readonly play: Function = (): void => {
        this.initialize();
        this.startPlay();
        this.endPlay();
    }
}

class Cricket extends Game {
    override initialize(): void {
        console.log("Cricket Game Initialized! Start playing.");
    }
    override startPlay(): void {
        console.log("Cricket Game Started. Enjoy the game!");
    }
    override endPlay(): void {
        console.log("Cricket Game Finished. Thanks for playing.");
    }
}

class Football extends Game {
    override initialize(): void {
        console.log("Football Game Initialized! Start playing.");
    }
    override startPlay(): void {
        console.log("Football Game Started. Enjoy the game!");
    }
    override endPlay(): void {
        console.log("Football Game Finished. Thanks for playing.");
    }
}

function main() {
    const game: Game = new Cricket();
    game.play();
    const game2: Game = new Football();
    game2.play();
}

main();
